home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 43 / Amiga Format CD43 (1999)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1999-09].iso / -serious- / programming / e / speedtests / speedtests.readme < prev    next >
Text File  |  1999-06-14  |  2KB  |  47 lines

  1. Short:    How to optimize in E
  2. Author:   misha@femina.com.pl (Michal Durys)
  3. Uploader: misha@femina.com.pl (Michal Durys)
  4. Version:  1.0 (30.5.99)
  5. Type:     dev/e
  6. Keywords: e optimization misha polska poland
  7.  
  8.               .---------------------------.
  9. -------------(         DESCRIPTION         )
  10.               `---------------------------'
  11. This package is a result of my adventures with code optimization in E. I
  12. want my programs to be as fast as it's only possible. To achieve this I
  13. did many tests. Now I decided to release the results to public.
  14.  
  15. These tests are fairly simple but very meaningful. Eg. did you know that
  16.  
  17. FOR i:=0 TO LOOP_COUNTER DO something
  18.  
  19. is almost ten times faster than
  20.  
  21. FOR i:=0 TO LOOP_COUNTER
  22.   something
  23. ENDFOR
  24.  
  25. Just look at the included results and you will discover more intersting
  26. facts. All timings were done on my A1200 equipped with Apollo 1240/040
  27. (overclocked) turbo board.
  28.  
  29. But remember that the tests are not fully reliable, for example edit
  30. increase.e and remove some tests like this:
  31.  
  32. PROC main()
  33.   test({addone},   'x:=x+1',      LOTS_OF_TIMES) ; x:=0
  34. ->  test({addql},    'ADDQ.L #1,x', LOTS_OF_TIMES) ; x:=0
  35. ->  test({addqb},    'ADDQ.B #1,x', LOTS_OF_TIMES) ; x:=0
  36.   test({increase}, 'INC x',       LOTS_OF_TIMES) ; x:=0
  37. ENDPROC
  38.  
  39. Compile the program and when you execute it you will get different results.
  40. I was not able to track down the reason. If you can fix it be my guest.
  41.  
  42.               .---------------------------.
  43. -------------(         DISTRIBUTION        )
  44.               `---------------------------'
  45. This package is public domain.
  46.  
  47.